package com.patterns.factory.NvWaFactory;

import com.patterns.factory.NvWaFactory.factory.AbstractFactory;
import com.patterns.factory.NvWaFactory.factory.Factory;
import com.patterns.factory.NvWaFactory.human.BlackHuman;
import com.patterns.factory.NvWaFactory.human.Human;
import com.patterns.factory.NvWaFactory.human.WhiteHuman;
import com.patterns.factory.NvWaFactory.human.YellowHuman;

/**
 * Created by Xiao Yiyun on 2017/6/28.
 * 女娲类
 */
public class NvWa {

    public static void main(String[] args) {

        //声明一个八卦炉
        AbstractFactory bagualu = new Factory();

        //女娲第一次造人，火候不足，产生了白色人种
        Human whiteHuman = bagualu.creatHuman(WhiteHuman.class);
        whiteHuman.getColor();
        whiteHuman.talk();

        //女娲第二次造人，火候过大，产生了黑色人种
        Human blackHuman = bagualu.creatHuman(BlackHuman.class);
        blackHuman.getColor();
        blackHuman.talk();

        //女娲第三次造人，火候刚好，产生了黄色人种
        Human yellowHuman = bagualu.creatHuman(YellowHuman.class);
        yellowHuman.getColor();
        yellowHuman.talk();
    }
}
